﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using DoAnASP;

namespace DoAnASP
{
    public class BUS_SanPham
    {

        public DataTable LoadSP_top()
        {
            DAO_SanPham daoSP = new DAO_SanPham();
            return daoSP.LoadSanPham_top();
        }
        public DataTable LoadSP_masp(int masp)
        {
            DAO_SanPham daoSP = new DAO_SanPham();
            return daoSP.LoadSanPham_masp(masp);
        }

        public void ThemSP(DTO_SanPham sp)
        {
            DAO_SanPham daoSP = new DAO_SanPham();
            daoSP.ThemSanPham(sp);
        }

        public void ThemTTSP(DTO_ThongTinSP tt)
        {
            DAO_SanPham daoSP = new DAO_SanPham();
            daoSP.ThemThongTinSp(tt);
        }

        public DataTable Load_SP()
        {
            DAO_SanPham daoSP = new DAO_SanPham();
            return daoSP.LoadSanPham();
        }

        public void CapNhat_SP(DTO_SanPham sp)
        {
            DAO_SanPham daoSP = new DAO_SanPham();
            daoSP.CapNhat_SanPham(sp);
        }

        public DataTable TiemKiemTheoTen (string name)
        {
            DAO_SanPham TiemKiem = new DAO_SanPham();
            return TiemKiem.TimKiemTheoten(name);
        }

        public DataTable TiemKiemTheoGia(int ID)
        {
            DAO_SanPham TiemKiem = new DAO_SanPham();
            return TiemKiem.TiemTheoGia(ID);
        }        

        public DataTable TiemKiemthuonghieu(int ID)
        {
            DAO_SanPham TiemKiem = new DAO_SanPham();
            return TiemKiem.TimKiemTheoThuongHieu(ID);
        }

    }
}
